package com.headingdata.define;

public class MethodDemo2 {

    public static void main(String[] args) {
        //打印三遍hello world
        printHelloWorld();

        System.out.println("---------------------------------------");
        //打印 n 遍输入内容
        print(10,"祖国万岁！");
    }

    public static void printHelloWorld(){
        for (int i = 0; i < 3; i++){
            System.out.println("Hello World!");
        }
    }

    public static void print(int n,String statement){
        for (int i = 0; i < n; i++){
            System.out.println(statement);
        }
    }
}
